various improvements

mysql fix