Fix for commit 9900db8 and a segfault in the PTH_EVENT_FUNC callback.