Moved two functions from 'retrostrings' to here.