Small bug fix: chains string wasn't produced correctly if rep chain  was
last in list