fixes #420, handle circular references in stylesheets