fixed issue where wrong rowtype count was being used