Stop Silverstripe from modifying href attributes

I've got a weird problem. When there's a <a href="#somethinghere"> tag present in the template, and visting a page with parameters in the url (i.e. /page/?foo=bar), SilverStripe adds the parameter part to the anchor tag. This in turn causes a javascript to break which is dependant on the content of the href part.

To show the example:

code on /page/

<a href="#tabs-1">

code on /page/?foo=bar

<a href="?foo=bar#tabs-1">

This behaviour causes Silverstripe to break the javascript and for some weird reason loads the templates TWICE! The #tabs-1 is part of the functionality of the jQuery UI Tabs addon.

Is there a way to stop SilverStripe from adding the parameter part to the <a href=""> ?

I already have

SSViewer::setOption('rewriteHashlinks', false);

active to stop Silverstripe from adding slashes to url's.

Help is much appreciated!

Edit: I seem to know what happens now. It doesn't break the javascript, but causes it to think i'm loading content into the tabs via Ajax. Because of the added parameter to the href tag, it thinks it's another url instead of the id of the tab. And that it shouldn't do, unless I tell it to.

Edit 2: Seems this is a conflict of functionalites of JQUI Tabs and Silverstripe. Silverstripe uses the base tag, so it *needs* to add the $URLSegment of the page before the anchor to make it navigate correctly. Then the JS "detects" a page url instead of an anchortag so it then loads the corresponding page into the displayed tab.

Guess i need to alter the JS to let it respond to something else, like title="#tabs-1" i guess.