diff --git a/lib/cpp/src/concurrency/Monitor.cpp b/lib/cpp/src/concurrency/Monitor.cpp
index 955fe9a..2443a6e 100644
--- a/lib/cpp/src/concurrency/Monitor.cpp
+++ b/lib/cpp/src/concurrency/Monitor.cpp
@@ -33,10 +33,10 @@
     
     try {
       int ret = pthread_mutex_init(&pthread_mutex_, NULL);
-      assert(ret);
+      assert(ret == 0);
       mutexInitialized_ = true;
       ret = pthread_cond_init(&pthread_cond_, NULL);
-      assert(ret);
+      assert(ret == 0);
       condInitialized_ = true;
     } catch(...) {
       cleanup();
@@ -52,11 +52,10 @@
   void wait(long long timeout) const {
 
     // XXX Need to assert that caller owns mutex
-    bool bret = (timeout >= 0LL);
-    assert(bret);
+    assert(timeout >= 0LL);
     if (timeout == 0LL) {
       int iret = pthread_cond_wait(&pthread_cond_, &pthread_mutex_);
-      assert(iret);
+      assert(iret == 0);
     } else {
       struct timespec abstime;
       long long now = Util::currentTime();
@@ -65,8 +64,7 @@
                                           &pthread_mutex_,
                                           &abstime);
       if (result == ETIMEDOUT) {
-        bret = (Util::currentTime() >= (now + timeout));
-	assert(bret);
+	assert(Util::currentTime() >= (now + timeout));
       }
     }
   }
@@ -74,13 +72,13 @@
   void notify() {
     // XXX Need to assert that caller owns mutex
     int iret = pthread_cond_signal(&pthread_cond_);
-    assert(iret);
+    assert(iret == 0);
   }
 
   void notifyAll() {
     // XXX Need to assert that caller owns mutex
     int iret = pthread_cond_broadcast(&pthread_cond_);
-    assert(iret);
+    assert(iret == 0);
   }
 
  private:
@@ -89,13 +87,13 @@
     if (mutexInitialized_) {
       mutexInitialized_ = false;
       int iret = pthread_mutex_destroy(&pthread_mutex_);
-      assert(iret);
+      assert(iret == 0);
     }
 
     if (condInitialized_) {
       condInitialized_ = false;
       int iret = pthread_cond_destroy(&pthread_cond_);
-      assert(iret);
+      assert(iret == 0);
     }
   }
 
diff --git a/lib/cpp/src/concurrency/Mutex.cpp b/lib/cpp/src/concurrency/Mutex.cpp
index 0f650a1..5993ea1 100644
--- a/lib/cpp/src/concurrency/Mutex.cpp
+++ b/lib/cpp/src/concurrency/Mutex.cpp
@@ -21,7 +21,7 @@
  public:
   impl() : initialized_(false) {
     int ret = pthread_mutex_init(&pthread_mutex_, NULL);
-    assert(ret);
+    assert(ret == 0);
     initialized_ = true;
   }
 
@@ -29,7 +29,7 @@
     if (initialized_) {
       initialized_ = false;
       int ret = pthread_mutex_destroy(&pthread_mutex_);
-      assert(ret);
+      assert(ret == 0);
     }
   }
 
diff --git a/lib/cpp/src/concurrency/PosixThreadFactory.cpp b/lib/cpp/src/concurrency/PosixThreadFactory.cpp
index a043418..972c1c1 100644
--- a/lib/cpp/src/concurrency/PosixThreadFactory.cpp
+++ b/lib/cpp/src/concurrency/PosixThreadFactory.cpp
@@ -69,31 +69,31 @@
 
     pthread_attr_t thread_attr;
     int ret = pthread_attr_init(&thread_attr);
-    assert(ret);
+    assert(ret == 0);
 
     ret = pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_JOINABLE);
-    assert(ret);
+    assert(ret == 0);
 
     // Set thread stack size
     ret = pthread_attr_setstacksize(&thread_attr, MB * stackSize_);
-    assert(ret);
+    assert(ret == 0);
 
     // Set thread policy
     ret = pthread_attr_setschedpolicy(&thread_attr, policy_);
-    assert(ret);
+    assert(ret == 0);
 
     struct sched_param sched_param;
     sched_param.sched_priority = priority_;
 
     // Set thread priority
     ret = pthread_attr_setschedparam(&thread_attr, &sched_param);
-    assert(ret);
+    assert(ret == 0);
 
     // Create reference
     shared_ptr<PthreadThread>* selfRef = new shared_ptr<PthreadThread>();
     *selfRef = self_.lock();
     ret = pthread_create(&pthread_, &thread_attr, threadMain, (void*)selfRef);
-    assert(ret);
+    assert(ret == 0);
   }
 
   void join() {
@@ -108,8 +108,7 @@
   void runnable(shared_ptr<Runnable> value) { Thread::runnable(value); }
 
   void weakRef(shared_ptr<PthreadThread> self) {
-    bool ret = (self.get() == this);
-    assert(ret);
+    assert(self.get() == this);
     self_ = weak_ptr<PthreadThread>(self);
   }
 };
diff --git a/lib/cpp/src/concurrency/TimerManager.cpp b/lib/cpp/src/concurrency/TimerManager.cpp
index 6ab0e76..050885d 100644
--- a/lib/cpp/src/concurrency/TimerManager.cpp
+++ b/lib/cpp/src/concurrency/TimerManager.cpp
@@ -96,8 +96,7 @@
 	  if (!manager_->taskMap_.empty()) {
             timeout = manager_->taskMap_.begin()->first - now;
 	  }
-          bool ret = (timeout != 0 && manager_->taskCount_ > 0) || (timeout == 0 && manager_->taskCount_ == 0);
-          assert(ret);
+          assert((timeout != 0 && manager_->taskCount_ > 0) || (timeout == 0 && manager_->taskCount_ == 0));
           manager_->monitor_.wait(timeout);
 	  now = Util::currentTime();
 	}
@@ -183,8 +182,7 @@
     while (state_ == TimerManager::STARTING) {
       monitor_.wait();
     }
-    bool ret = (state_ != TimerManager::STARTING);
-    assert(ret);
+    assert(state_ != TimerManager::STARTING);
   }
 }
 
diff --git a/lib/cpp/src/concurrency/Util.h b/lib/cpp/src/concurrency/Util.h
index de4d578..fe12b49 100644
--- a/lib/cpp/src/concurrency/Util.h
+++ b/lib/cpp/src/concurrency/Util.h
@@ -68,7 +68,7 @@
 #if defined(HAVE_CLOCK_GETTIME)
     struct timespec now;
     int ret = clock_gettime(CLOCK_REALTIME, &now);
-    assert(ret);
+    assert(ret == 0);
     return
       (now.tv_sec * MS_PER_S) +
       (now.tv_nsec / NS_PER_MS) +
@@ -76,7 +76,7 @@
 #elif defined(HAVE_GETTIMEOFDAY)
     struct timeval now;
     int ret = gettimeofday(&now, NULL);
-    assert(ret);
+    assert(ret == 0);
     return
       (((long long)now.tv_sec) * MS_PER_S) +
       (now.tv_usec / MS_PER_S) +
