Fix method to ensure directory existence.
Fix dir creation.