Added When overload
Fixed bug in ToRex()

Was not completing after error.