Fixed database load and deletion operations.

Fixed malfunctioning SQLite query statements. Still need to fix event
display.