Fixed ~isscalar error with ~isempty