Fix deprecation warning in attribute handling