Fixed name in constant
Added better detection of attributes.