Fixes issue with switching layers
Merge pull request #87 from heiglandreas/hotfix/switchType

Fixes issue with switching layers