Fix Windows compatibility, escape args and remove useless operation