Fix attributesToArray when you have set some attributes to hidden