Made isClosed volatile in ERAT and made more vars final.