Fix PWX export SEGV

fixes #654.