Clearer semaphore error messages, removed some legacy code, fixed a compile warning or two.
Added semaphore fail message when a semaphore cannot be opened.