Fixing template related issues