environment: Fix transition callback
This is rather embarrassing - we currently confuse the transition with the finished parameter, which means we always run the onComplete handler no matter whether the transition was interrupted or actually completed.