Revised error formatting, fixed tests