Really fix edgeCount error, add better tests for it.