memory fixes for Core