fix node attribute rewriting and add embed rules