Fix determining current app