Added -nobuf option, and changed flush to occur after every record if -nobuf is set.