fixing typo in documentation and small bug in index.js