Fix compatibility issues for Octave and Ubuntu