portability stuff, tweaked unitbuildingmodule
Merge remote-tracking branch 'origin/master'