Add more test for Scan and found some bugs and resolved.