Fixed SQL-database not working correctly.