Fix bugs after got the first real sample stream

Just got the readl sample trace stream today.
After tested, there are many bugs found and fixed.