Added one more test and fixed bug that function would return wrong list