Fix semaphore
Merge pull request #1864 from erwinwinder/master

Fix semaphore