minor updates and bug fixes

fixing a sorting error in javascript_functions.js due to recent update.