Fix MapgenV6::generateCaves possible division by 0 and misc. cosmetic fixes