Bugfix/handle mark as pending delete

Fixes #602