Fix warnings when building in RELEASE mode

on Windows and on Mac (for the latter this PR does fix some, but by far not all warnings, at least not yet)