Fixed bugs. Implemented simple battle AI.