Beginning of fixes for database data retrieval issues.