Fixes crash on Solaris

This change fixes a crash on Solaris as reported in #38.