Clean up the engine constructor.