Make solid angle computation more robust to numerical errors.
Temporarily fixes #129.