Template.merge() failure. The document is null, most likely due to parsing error.