Fixes heartbeat and NoneType error.  Closes celery/celery#1790