Some code cleaning
Merge pull request #3 from terwey/errors

Some code cleaning