Attacking pushes enemies away. Some minor refactoring and fixes.