Improved handling of errors in post proccess scripts