changes to sqrt args to make MSVC happy