Corrected the boolean conversion approach to a proper implementation (as motivated by @controlflow).