Fix row count bug