Added the terminate all function and added it to the place where it can happen.
Merge pull request #10 from nwnoga/pa-errorTerminate

Added the terminate all function and added it to the place where it can ...