A more robust way to prevent compile-time errors in init()
Fix deprecations