Fix deprecation warnings

"Writing arbitrary attributes on a model is deprecated"