Fix bad substitution error, add jip dependency and make scripts more robust.