fixed the handling of non-commands and jslint-ed the file