Update docs and fix sloppy js