memory leak and java8 issue fix

Hi,

You may be interested in the following fixes.

Greetings,
Michael.