finished cleanup in md_support.c