Added compatibility for chrome and fixed issues with node.js comaptibility