Imported latest changes from Superiority Complex.