Fixing the conversion of modes from string to integer. The string mode is now converted to an octal integer.