Fixed initialization problem in NamedPipe
Added some testcases to QA test.