Fix bug with boolean conversion