Some more refactoring.
Make sure the mount and temporary locations are created before trying to use them.