Added file mode preservation