Some corrections to mdnie code