a big bunch of security-related improvements