Improved credential handling.