Made it possible to exit cleanly; perform proper intialization