Merged from zongping and tangjing

Alex, you can get a whole review over all these changes.