Fix bug in idle barrier code