Fixed problems with templates and order validation