Fix registration regression bug caused by #151