Fix order of scripts to run so it finishes successfully.