Fixed possible double free
Fixed issue tracking qi sets