Add test case and fix some remaining issues