Fix listdir exception.