Bug fixes in MySQL and Collection