fixed #7. added null checks around block callbacks just for fun.