Various changes merged from old SuperProject.