Fixed error on record count being returned