Previously this would always return false due to how explicit bool is evaluated in a return context. Also add a test for this function. Reported by: jcreigh