Some js-related fixes