misc fixes (still not quite working)