Refactor out remaining calls to row_count

See d56f63de206889072f5aad25543d8f2882beb7cc