remove valid() and fixe minor typos.