Cleanup

See individual commit messages for details.