Improved prefix/suffix generation.