Fixed bug with directories