Don't mess up with redirects
Improve handling of regexp
Make tests more comfortable