Fixed multithreading bug when split dimension is lower than number of
threads