More enhancements to JavaScript coding