Merge "Fix a few bugs when running with -u"