Fixes in checkForDisplay to eliminate errors