Bug fixes for MySQL and encoding issues.