Changed the throwing of errors