Properly Create Folders

Fix some issues, and clean up some code.