fix argument checking to avoid msvc compiler warning