Updated OBJ-C and Java to have new option parameter 'stopOnTerminate'
fixed typo. added all stop code to terminate callback
fixed some wrong indexes in config functions