Updated database functions.