Added better error handling and updated README.