Fixed paths handling code to support folders containing spaces.