fix buildAttributes setting of empty [] and {}