Regularizing divergences in the von Neumann entropy