Better error report and small test refactor