Fix empty preferences window problem