more tweaks for batch optimize scripts