Corrected a bug in remove_thor, added debug