Change DEFAULT_BUF_SIZE from 4096 to 65536
Fix some bugs