Revert "Tweaked number_valid? to fix Semaphore tests."

This reverts commit 91ae89e0dfc4942b6f6171803e3111381942df74.