Importing more changes from Junjie.