Merge "Fix bug and migrate test." into sc-dev