Added implementation for toString methods on classes.