Fixed bug in converting list