fix warnings from MSVC and remove trailing whitespaces