ENG-4906: add more test case and other minor changes.