Database fixes, data collection fixes