fixes a bug in noclasspath mode (NPE in some special cases)