Fixed generation of tables for intermediate classes in CTI
Another fix for CTI mapper
Tests for the latest CTI fixes