Add more checks to the getCodel method of Program