User input checked and handled.

Checked the message format entered by user so that the app doesn't die
when passed something unexpected.