Template direct access security and logging, initialization bug fixes.