Fix deprecated methods and missing constants.