Fixed a bug in security initialization