Fixed #169, More improvements on locked files issue