FIX: openSession may return 3 values (<0 if failed)