misc fixes

I'll work on sorting out the issues later