Housekeeping in main script.