Carriage Regurn respects origin mode
Fix reference errors around DECSCA
Add missing local variable declaration