fix str_repeat bug in x0r, add comments