Major sync with new code.
Major sync