Some tweaks based on work to get sessions working in AWS CLI.