Added a bunch of error handling code instead of silent failures.