Fixed registerFunction not working with const functions