Updates to MySQL code