Various fixes

This patch resolves the child reaping bug (issue #11 ) and the Segfault problem on OpenBSD (issue #15 ). It has been tested on Debian 7 (Wheezy) and OpenBSD 5.6/i386.