Fix multienvironment login a bit more.