Updated to use up-to-date DB API.