Updated code to make errors more transparent for DTD and RA exercises