removed 2 exit() calls from library code