onDeactivation translation now takes conditions in the generator expression.
Partially fixed a bug in the onDeactivate translation.
Amended onDeactivate translation and fixed bugs.