mdec.cpp - cleanups