Fixes prefixes and suffixes trimming