Small improvements for JavaScript