fix gotos and self-redirects