autoscan and scan optimizations
Merge pull request #812 from andrzej-jankowski/scan_schedule_fix

FIX - autoscan and scan optimizations