Fix issue with unregistering the broadcast receiver.