Inspire next - fixes for bugs found during moving to inspire db