I've changed the error handling. Was a mess to do so because of other changes from Andy, but its done.