Clear references to application object. This fixes issue #23.