Fix listdir bug from previous commit