Fixed(/work around) error with x variable sometimes being a cell array.
Commentd out try-catch to let errors be handled elsewhere?