Added common teardown and tests for pre-initialized memory.