Better security checks (bounding the map).
Cleanup.