Fix redirects

1. Don't append data to redirects.
2. Don't echo output, that kills the headers.