More work on fixing database view.