What's the reasoning for the cast to bool here?