Fix bug for 3-state boolean