Changes to work with security 3.1-SNAPSHOT

Changes to work with thread-safety changes made in security 3.1