added max-iterations flag
fixed misspellings
fixed uninitialized iterations_done
fixed if condition
optimization of --iteractions-max stuff for non-pthreads mode