Minor improvements to attribute handling.