Added test and fixed incoming stats tracking in some cases #302