Updated to work with MySQL properly now