Change proc.wait to proc.poll. Fixes #455