another bunch of fixes