Fixed single table inheritance handling
Added tests for single table inheritance