Fixed rowcounting bug