JS backend: more nits, fix array check