Don't destroy url fragment, fixes #646

as discussed in #646