Fix string.rep crashing