fixed _transform() and _flush()

Fixed _transform() and _flush() functions for 0.10.x.