Minor bug fix in list printing