Fixed a message/user history regression issue and capped message history