fix a bunch of errors with validation