WYCS: added more test cases, and bug fixes.