Fixed crash at mapswitch

Reviewed-by: bjorn.