Fixed bug in formating error message