DDF-645 Fixed various bugs with initialization code that was not allowing security to work out of the box