Fix validate script and improve output