Fixed bug in rankZ function when NAs were present.