Wasn't pushing the optimal half of the array onto the stack, thus used more stack than expected -> overrun.