Fixed closed cursors

Closed cursors should raise InterfaceError
Merge branch 'fix-closed-cursors'