Fix Deprecation Warnings

The project contains various deprecation warnings which are easy to
fix.