Small refactoring.
Makes sure the beam directory exists.
Fixes Map body.