Fix registration bug