Fixup automated build.

Also finally restored DEBUG_MALLOC and CHECK_MEMORY. Every thing is accounted for and tested.