added stack option for SGE (needed for java), and better logging on parse errors