Fix #683

#683

Note that I didn't change the error message. @grosu if you tell me what message to print I can update.