Fixed definition xml, added more error checkings in Java code, modified script file to use relative path