similarity measure bugfix