Use == instead of === for exact_length()

This is a fix for #4713