some bugfixes in ddl compiler for implementing indirections