Build fixes / issues pointed out by Ms2ger