Fix OSX assertion failure at startup

An error value was being incorrectly checked.