Fix issues with # and add token to path instead of fragment