Fix attribute encoding