Develop

Please see the comments on the individual commits for more details.