Scabrero/fix memory leaks

indeed