Add deletion of references. Fixes #51