Fix "select with index 0" bug.

Fixing a bug where, when trying to select with index 0, it was ignored because 0 is falsey. In stead, explicitly compare with undefined.