Small tweaks to ES script