Some SQL stuff updated