Add core.clamp function.
Tweak map generation.