Next batch of memory fixes