Test/list directory with subdir

This is the result of the discussion in #585.