Fix incorrect suffix trimming logic

closes #3159