fix bug in save return value and streamLength return value.