memory fixes