fixes to 5_Database_Functions.R