Fixing some bugs where missing elements caused a 500 error when grading

This was due to the node list being empty in the DomCrawler