Bugfix for delete (wasn't working properly with extended cursors)