Core: fixes bug where ? with no query would be added to URL