Fixing shutdown bug.

Actually remove the right application.