doc fixes and parameter check
code formatting
documented 5.2 variant of string.rep