Fixing an SQL bug, polishing the user interface