Mysqli typo, bug fixes