Fixed crash while deleting notes.
This probably has a regression though.