Fixed problems with untyped enum and templates.