Fixing MySQL scripts