Merge pull request #584 from leonindy/master

fix serval bugs found in code review
fix a bug about getting null machine in HeartBeatAlert