Some fixes. Add utilities related to SQL