Call afterLayergroupCreate only after MapConfig verification

Closes #159.
Includes testcase.