Fixed bugs in madlib.summary