bugfixes to maxmatching