Added missing explicit cast from shared_ptr to bool.