Fixed a bug not detecting the context on XHTML pages.