Fix some peeking issues, add some header comments for peeking protocol