Debian: fixed bugs in app upgrading