fixing regression bug in error handling that broke registration.