Fixed the issue when setting the Presence Heartbeat, updated unit tests