cleaned up filetype logic for octave