Fixed track type conversion bug.

Also renamed cstack to clearer commandStack.