Fixed some bugs when a marker updates its model

Hi again,

I've re-done the bug fixes with the latest version of the repos.

Jaume.