Added license, fixes for cross-db compatibility.