Added tests for Scan.
Minor fixes in other tests.