Fixed issue when registering moodle user.