Properly detect heardbeat messages