Applied all of the changes in Ablu's autoattackfix branch to master.