Updated to match latest API.