Fixed security plugin and minor code beautification