Made the application exit on close.