Classic biped walking controllers assume a perfectly flat, rigid surface on which the robot walks. While walking over unknown terrain, robots need to sense and estimate the ground location. Errors in this estimation result in an unexpected early or late ground contact of the swing foot. In this paper, we analyze how these errors affect walking stability. Based on simulation results, we propose a strategy that mitigates this effect. We show that if the ground height has an associated uncertainty, an overestimation of its value results in a more stable walk. This overestimation depends on both sensor data and the robot's dynamics. By using a reduced robot model, our strategy could be implemented into the realtime control to make the robot more robust against perception errors and irregular surfaces.