Update logdet. Close #3070.