Fixed wait condition in Buffer