Fix templates according to security options