Fixed wrong file mode