Fix the incorrect return type in function list_length