Fixes for mysql_connect deprecation and Writer.php error