fix up whitespace and type attributes