Fix test and properly calculate incoming and outgoing. Closes #156