Fix #1731 to allow samples with multiple file extension segments.