fixed bugs in list_size() and compose_nd()