Fixed a bug for dup3