Fix limits in query