Fix interruption handling.

Fix #17.