Separating variable declaration from first assignment, which should fix some ksh problems.
Make sure `nvm ls foo` returns a nonzero exit code when a version is not found.

Fixes #440.