1. Fixing memory leaks mainly