Add flow control.

Fix #10.