fixed some issues with directories not being assigned or created.