Added a test case, further enhancements.