Clarified logic in remove_delimiter.

Motivated by warnings from clang static analyzer.