Small fixes to make script usable on our setup.