Rearranged OE loop and fixed bug where loose convergence criteria would cause the program to crash.