Fix problem with malformed authentication headers