Fixed catalog read and memory management for Java.