Improved validate_csr