Fixed out-null in directory creation