Fix portable mode (it passes tests now.)