Fix an error which was thrown by the PresenceHandler _on_shutdown handler.