Add more checks and fix some callers to make sure that the server core always has a valid screen layout configured.