Revert "Changes to avoid segfaults on Solaris"

This reverts commit f3f4624b001d9407bd92d00a1284373362d5fe00.