Another fix for #31.

This seems to have done it, no more crashes for me.