Improved Mat::release()