properly handle scalar data format in attributes reading