Fix for generting URLs using anchor().

Instead of always appending "?" to the URL the anchor() method should only do
so when there actually is a query string.

Signed-off-by: Yorick Peterse <yorickpeterse@gmail.com>