Some small fixes, comments, and mysql code.