Fix registration bug on OS X.