Adding tests for error formatting