Additions and fixes

Fixed the ending ) in the SQL queries and added statements to the
upload function.