Fixed digest authentication and minor changes