Small fix to handle matrix input in Cubic