Merge pull request #1791 from WalterBright/scan