I was not removing context when I was leaving a tag. This caused the context to grow indefinitely, which is not a valid representation of where the placeholder was located in the template.