Fixed bug if rank is 0