Properly handle transfer of application (bug #911)