Copy paste error in script, also corrected some method accessibility in java.