Fix error where we cannot create a directory
A little cleanup