Fixed quoting, now works even when paths contains special characters (e.g. spaces).