Fixing bug in the implementation of betweenness tests