Fix for issue #15

This patch resolves the Segfault problem on OpenBSD and has been tested on Debian 7 (Wheezy) too.