Process handling is a bit spotty at the moment. Improve it by using some reference implementation, e.g. this one.