Issue #326:
- Reworked previous fix for better handling of marker index and avoiding
  deadlocks