Change some interfaces. Fix compilation errors.
Add the missing file in the last commit.