Changed to handle null string (octave returns lenghth of 1)