Fixed wait and notify calls