Optimized path finder. Cut execution time in four
Fixed NPE on idle timeout on ai command