Bugfix redirecting from applying xquery.