Fix for switching apps (issue #5).