make scan_forward in flog0 a tail call;
flush stream when dumping
Merge pull request #4 from Incubaid/scan_forward

make scan_forward in flog0 a tail call;