Fix directory filtering