Fixed enemy array handling and finishing optimization