Added better error formatting