schema mode cleanup + more tests