Fix AttributeErrors.