another bunch of various fixes found during testing