Fix equality bug and deprecation warning.