Added some more tests, fixed bug with exception inheritance
Merge from feature/aggregates