Timeout handling.

Closes #27.