Minimal fix to contrib/cube and contrib/earthdistance