Duplication after rewrite OK
Cleaning logs and removed a leak in rewrite