Fixes for standard template generation: avoid downsampling on standard files and do streamlined duplication marking