Fixed bug in invert condition.