Initial fixes to translated template parsing/writing support