Changed bad cast in MxArray