fixed errors in domain classes and templates