Fixed NPE bugs of Repartitioner