Added a better check for flatworlds.