Make optimization an option
Track origins of memory errors