fixed index.js typos and bugs

updated expected test results