Fixed PSR-1/2 incompatibility
Fixed Exceptions not written
Added integration tests