Fix minor memory leaks in detail file reader