Fixes for issues found during security testing.