Added more ERROR catching to prevent program aborts.