squash some compiler warnings

MSVC complains about some lines of code. These are the changes that also make sense on other platforms imho.