Fix registration bug; implement #24