Replicate issue in test
Fix boolean logic