Bug fixes to bipartite.py