More fixes

At some point many of my fixes got reverted. Just check commit log for main repo. 
Until I figure out what witchery is that, no more fixes.