Updated to work with latest engine.