Improved tests, value cleaning and validation