Bug fix on rim generation.