Fix for WK-58: Karma executes the wrong PyTransform command

Handle the Previous Transformation Command by looking in the History
object instead on relying on prevCommandId variable.