Added error checking for range sensor measurements.