fix opening viewer multiple times from java program, fix init of black background