Fixing template variable access warnings