Fixed a few security issues in WPEC and adhered to "standards"

Still not according to standards.