Fixed bug in error formatting