Fix memory leak in bt. credit: dzo