Javascript bug fixes related to creating scripts with pre-defined
locations