Further memory leaks fixed and crash resolved.