fix for VS. closes #2186 closes #2213