Misc fixes

more fixes coming, don't merge yet