Bug fixes to scans