Matrix constructor only uses dimension, add destructor.