some quite critical fixes