Fix "IndexError: pop index out of range"

Account for the index offset caused by popping items from self.marks.
Merge pull request #22 from adametry/master

Good catch, thanks!