Fix clang warnings
Fix use of free() instead of delete()