Some fixes for rdbms