minor bug fixes
proper URL replacement, escaped fragment in querystring
default is root