Fixing the way _id is gotten from the markers for advanced compilation

Closes #998