Fixing issues with node v0.8 compatability and some other bugs