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