add peek protocol, fix string.sub bug. thanks @aoxu #3