Better SQL statement generation, and visual tweaks.