Fixed command complete in windows, and add test case.