Fixed check for session getMessages
Whitespace fixes