Fixed bug when reallocing last allocation

Fixed bug when reallocing last allocation where the dmt_head variable
was not set to the now reallocated memory address.