lots of validation fixes