Fixed handling of last delimiter.