fix few bugs, add some initial testing of situation where battle is over