Fixed compatibility issues with chrome canary

Chrome canary may use a stricter rule set on javascript? Updates to fix
minor errors.