Fixed some memory shenanigans in windows dir implementation