removed most exit() functions.