Fix and tidy up error messages
Remove superfluous return statement
Merge pull request #1 from bouk/master

Tidy up the code a bit