Changed error handling in various places.