Various fixes
Lots of fixes