fix some msvc compile errors
overusage of "auto"