Speed control of hydraulic motors