Added more robust handling of seemingly invalid bookmark ranges.