Fix bug in matrix logarithm