Improved state switch
Merge branch 'develop' of github.com:mickdelange/cclab into develop