Added a check for None callback functions, so that they will be treated as NULL pointers.