Small tweaks and js functions