Fix priorities for template options from linked resources
Add function to dump template options
Merge