added an example using objectMode; more bug fixes