Fixing random bugs in SQL statements and such.