Fix comparison bug in JS fallback