Small JS improvements