better error handling for service registration, fixes #239.