Fixing headers, other fixes, extension template improvements [ci skip]