Fix for setfield deprecation