Fixed SQLite3 not writting to the database correctly.