Various MATE fixes via patch from tidux@ma.sdf.org.