Fixing bug in refac_unreferenced_assign and adding more tests