Fixed resource leaks

Several instances of JarFile were not properly closed.