Improved profile js, and a few other things