terminate on error flag; fixing bug on setting trial outcome; fixing bug on max rewards per trial