Fix registration, minor tweaks, cleaning