Some fixes.

The most of them are for mysql system.