v2: fix write deadline. Fixes #28.