Fix return value of register function