Fix leaking file pointer.
Fix possible NULL pointer dereference.
Add cov-int and *.tgz to .gitignore.