Fix bug in average weighted connectivity for when using in-degree

Fixes #627.
Add test.