Fixes #9. Rearrange execution so that child prints before it exits.