Added a testcase for #199 and implemented #199.