Small improvements and fixes.

Using a constant instead of hard coded number for the max number of
screens.
Making sure some vars are initialized to nil and not garbage.