Deleting last child should mark it's parent as having no children

Fixes #50
Merge remote-tracking branch 'upstream/master'