Many script changes, mostly about Condition#wait