Fix atomic marker comparison logic

Closes #2629