Optimizations for markers (clamping count to 100)

This fixes #1282