Set the correct prototype object of error objects