MySQLi support & bug fix