Better check of both model and available

Why can those variables be undefined so often that the check is
necessary?