3.0 fix comparison

Fixes #5081