Fixes for MySQL 5.7