Fixed deprecation issues