Some unit tests
More exception handling