Fixed CF memory leaks