Fixed referencing id[-1] in case of the first node.
Merge pull request #7 from yuvalg/db-structure-yuval

Fixed referencing id[-1] in case of the first node.