Rearrange code
midpoint = true -> type = 'midpoint'

Makes it more consistent with entities.