Added fix for scan routine.