Remove incorrect flat qualifier and clean up unused attribs