Fixes for clearing memory.