BROKEN Bugfixes to schema handling