Fixed the bug mentioned in previous commit.

The problem was that I forgot to assign objects unique id's, so they were
getting each other's cached geometry confused.