memory fixes 2 from Otila