JS-related fixes