Return code on interrupt

Fixes #266.