safety fixes and a little branch prediction helping in CyFunction utility code