Better error message, fixes #607