Fixed a small regression in getNextAfterLastPosition/getLastPosition

Hi @franzose,

I discovered a small regression in the code that obtains the last position + position after the last position. This would cause the second element to be created under the same parent to have its position being clamped between 0 and 0 (getNextAfterLastPosition() would be returning 0 instead of 1).