Remove delay. Add error handling. Minor cleanup.