fixed Task onRegister, more tests