DB/SAI: Fix some db errors