fix boolean expr in 'when' clause