Fixes issue 1140
Cleaned ifs

Thanks to Ian-Foote
Merge pull request #1141 from Gipzo/fix-screenmanager

Fixes issue #1140