Added 'ORDER BY pk' to the queries.