liblist: fix error handling