Fixing deprecation errors  during compilation