Merge pull request #369 from euanh/build-improvements

Build improvements