Fix for Bug#3757: All dimension values are 0 after release is called

Fix for Bug #3757. 
Made all dimensions 0 after release is called on a Mat object