Small tweaks to parseMessage()
Merge pull request #221 from Morfent/parsemessage

Small optimizations to parseMessage()