Added support for directories (compatible with directories created in AWS console)