Fixed two problems with JAVA_OPTS handling