Fixed some issues with registration