Start using JSHint and fixing a bug