Some fixes -> result sets, referential constraints, sql logging