Fix bad method name and bad variable access

Fix a bad method name in constructor and fix accessing errorCodes from local to through $this.