various schema related bugs