Coding style and test coverage

Hello,

I think you have a fun idea and decided to contribute a bit:
* I pushed some small coding style changed, mostly related to consistent indentation in the code.
* Added a couple of tests for error cases, so the test coverage at the moment is: 96%