Added indentation to blocks in encode function, to ease development of enum support.