Manual merge of the build fixes by nicad from pull request 57