Fix bug when using the '-o' option and creating nested folders.