Added package with custom exceptions
Custom exceptions and clean-up in tests
Several small bugs fixed