Fixed ping bug causing user to disconnect.
Fixed duplicated messages when a user messages themselves.
Other changes.