Fixes a bug when a page contains multiple stylesheets.