Better use of gCond, better end handling