Polish security

This contains the a number of items for Security that polish it up. Please see the commit comments for details.