Let both scripts really work with either temporary or existing directories