memory fixes from Otila