Fix issue with setting compiler flags for MSVC and change some variable names for clarity.