Various changes

See commits for changes.