[BUG] Important bug fix in an optimization.

Reduction(axis!=0) of joins(axis=0) wasn't working on the right axis.

fix gh-2109