Fixed a bug with registration.