Actually fix stuff in both parts of the if/else construction in the SQL class