Fixed 1.7 deprecation warnings.