Improved attribute handling