Fixed result set bug