Added full dispose method and correct system exit procedure