Resolve crash workaround

Note: This pull request replaces the fix for #91. Please check first if the said issue is fixed by the workaround.

I also added a small, unrelated patch.