Fixed registration function.