Fixed calls to database for Omeka 2.0 stable release.