Fixes bugs in nightly processing script.