Fixes row counting problem