Correctly count rows. Add better handling for when there is more than one row.