Replacement by dictionary works for attributes