added trimming dashes after replacing took place, updated tests