Fix spurious wakeups