Fixed fatal bug in index.js.