Fix destroy function

Fixes destroy, which previously would overwrite the entry with uninitialised data, which might not set the deleted flag.