various fixes I never committed