The issue is that when deleting a single note (with ID lower than max) wrong notes is opened next time clicking at any other note.
This issue appeared after the redesign, where ID of a note was replaced with just an index in the collection, so most probably it's just a simple off-by-one error.
This applies mostly to the database handler.