Numbers are now placed appropriately depending on the positions of the previous and the next node. Fixes #3