Fixing memory issues.