bugfixing, added interrupt support. Fixed tests