Fix NPE when setting up portable mode reinstalls