Fix bug in invocation of process.poll()