Add round trip test case and fix a bug.