Slightly saner way of getting new IDs: a counter.