Add some new diagnostic code to the engine detection routine.