Bug found. Code cleanup. Next: Performance investigations (profile) and unit tests (JUnit) and probably some refactoring.