Add simple context checking for xpath helpers.