Ensure correct array dtype in centroid_com