Fixing bug in Messages.js.