TESTING: added new test case.
TESTING: fixed up some bugs in test case.