Fix calculation of mode_octal