Some more fixes to handle newer versions fo the  MySQL datbase