fix some attributues and sanity checks on length of attribtues