Fixed errors on user registration,
seems to work mostly fine.