Build-script tweaks.
Merge remote-tracking branch 'upstream/master'
bugfixes