Fixed 1.12 deprecation warnings