Fix security preamble and make it consistent in a few cases where it deviates
slightly.