Updated constructors to remove vulnerabilities