Bug fix for registering.