Input and output redirection sworking, but it keeps incrementing file descriptors every time you redirect.