Fix issue 12 multiple instances created

This pull requests contains a bug fix for issue #12. 

Additionally I tried to fix tests that where failing due to the switch to JDK 8.