Make count_all use table_name.primary_key instead of just primary_key