Don't implicitly convert int to bool

This avoids warnings with MSVC.
Merge pull request #1587 from mstorsjo/msvc-warnings

Don't implicitly convert int to bool