Fix method counting disjoint memory areas.

Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>