Main window: Fix optim after single scan

Signed-off-by: Jerome Flesch <jflesch@gmail.com>