Fix range check on timeout, as it always evaluated to true