Merge pull request #1153 from isao/fixlint

fix lint: i++ -> i += 1
rm unused vars
more lint: no need for typeof to check === undefined