Another minor bug because I forgot to take defeat into account. Please work now.