Fixed calling a registered function