Update script to do error handling, and inclusion of extra header file removed