Fixed a bug that accidentally returned the error string instead of raising an error