Improve attribute value handling