There were some issues with complex commands lines including many ">", "<", "|".
This has been corrected by adding pipe creation after execution of command that has its stdout redirected to file.
And also adding some more verifications when redirections stdin, or stdout, or both are performed between two "|".

Everything seems to be fixed, now.