Add type attribute to Reader/Writer